<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>修改人才大数据</title>
		<link href="__CSS__/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__CSS__/iconfont.css" />
		<link rel="stylesheet" href="__CSS__/style.css" />
		<link rel="stylesheet" href="__CSS__/mall.css" />
		<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.3&key=ebc4693ac7f608307dc039bd33c39675"></script>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" id="return"></a>
			<h1 class="mui-title">修改人才大数据</h1>
		</header>
		<div class="mui-content ">
			<div class="gerenzl_nr">
				<form id="myForm" class="mui-input-group gerenzl_group">
					<div class="mui-input-row ">
						<label><em>*</em>真实名称</label>
						<input type="text" name="real_name" value="{$model.real_name|default=''}" class="mui-input-group" placeholder="请填写真实名称">
					</div>
					<div class="mui-input-row ">
						<label style="width: 50%;">建档立卡扶贫户</label>
						<select style="width: 40%;" class="mui-btn mui-btn-block" name="jiandang" >
							<option value="0" {if $model.jiandang=='0' }selected{/if}>否</option>
							<option value="1" {if $model.jiandang=='1' }selected{/if}>是</option>
						</select>
					</div>
					<div class="mui-input-row ">
						<label><em>*</em>本人照片</label>
						<div class="actions" style="float: right;">
							<div class="file-btn" style="border: 1px solid #CCCCCC;">
								<input type="hidden" id="thumb" name="thumb" value="{$model.thumb|default=''}">
								<input onchange="UpladFile('people', 500)" type="file" accept="image/*" id="file" name="file" multiple>
								<span><img class='img_list' src="{$model.thumb|default='__IMG__/logo1.png'}" id='thumb_img' style="width: 100%;height: 100%;border-radius: 100%" ></span>
							</div>
						</div>
					</div>
					<div class="mui-input-row">
						<label><em>*</em>联系电话</label>
						<input type="text" name="phone" value="{$model.phone|default=''}" style="width: 65%;" class="mui-input-group" placeholder="请填写联系电话">
					</div>
					<div class="mui-input-row">
						<label><em>*</em>性别</label>
						<select class="mui-btn mui-btn-block" name="sex">
							<option value="1" {if $model.sex==1}selected{/if}>男</option>
							<option value="2" {if $model.sex==2}selected{/if}>女</option>
						</select>
					</div>
					<div class="mui-input-row">
						<label><em>*</em>就业状态</label>
						<select class="mui-btn mui-btn-block" name="work_type">
							<option value="1" {if $model.work_type==1}selected{/if}>可做临时工</option>
							<option value="2" {if $model.work_type==2}selected{/if}>正在找工作</option>
							<option value="3" {if $model.work_type==3}selected{/if}>可兼职</option>
							<option value="4" {if $model.work_type==4}selected{/if}>在职</option>
						</select>
					</div>
					<div class="mui-input-row">
						<label><em>*</em>出生日期</label>
						<input style="height: 40px;" name="birth" value="{$model.birth|default=date('Y-m-d')}" data-options='{"type":"date","beginYear":1901,"endYear":{:date("Y")-1}}' class="btns mui-input-group" placeholder="出生日期">
					</div>
					<div class="hy_line"></div>
					<div class="mui-input-row">
						<label><em>*</em>最高学历</label>
						<select class="mui-btn mui-btn-block" name="xueli">
							<option value="1" {if $model.xueli==1}selected{/if}>小学</option>
							<option value="2" {if $model.xueli==2}selected{/if}>初中</option>
							<option value="3" {if $model.xueli==3}selected{/if}>高中</option>
							<option value="4" {if $model.xueli==4}selected{/if}>大学</option>
							<option value="5" {if $model.xueli==5}selected{/if}>其它</option>
						</select>
					</div>
					<div class="mui-input-row">
						<label><em>*</em>工作种类</label>
						<select class="mui-btn mui-btn-block" name="cate_id">
							{foreach name='cate' item='vo'}
							<option value="{$vo.id}" {if $model.cate_id==$vo.id}selected{/if}>{$vo.name}</option>
							{/foreach}
						</select>
					</div>
					<div class="mui-input-row">
						<label><em>*</em>期望月收入</label>
						<select class="mui-btn mui-btn-block" name="wages">
							<option value="1" {if $model.wages==1}selected{/if}>2000以下</option>
							<option value="2" {if $model.wages==2}selected{/if}>4000以内</option>
							<option value="3" {if $model.wages==3}selected{/if}>6000以内</option>
							<option value="4" {if $model.wages==4}selected{/if}>6000以上</option>
						</select>
					</div>
					<div class="mui-input-row">
						<label><em>*</em>职称</label>
						<input type="text" name="cert" value="{$model.cert|default=''}" style="width: 65%;" class="mui-input-group" placeholder="请填写职称">
					</div>
					<div class="hy_line"></div>
					<div class="mui-input-row">
						<label><em>*</em>工作地区</label>
						<input type="text" readonly="" placeholder="请选择地区" id="myAddrs" data-key="{$model.area|default=''}" value="">
						<input type="hidden" id="area" name="area" value="{$model.area|default=''}" />
					</div>
					<div class="mui-input-row">
						<label><em>*</em>详细地址</label>
						<input type="text" name="address" value="{$model.address|default=''}" class="mui-input-group" placeholder="请填写详细地址 ">
					</div>
					<div class="mui-input-row">
						<label>备注</label>
						<textarea name="content"  placeholder="请输入备注" class="layui-textarea" style="border: 1px solid #CCCCCC;">{$model.content|default=''}</textarea>
					</div>
					<input class="lng" id="lng" name="lng" value="" hidden="hidden"/>
					<input class="lat" id="lat" name="lat" value="" hidden="hidden"/>
					<button type="submit" class="fjysq_sbtn">保存</button>
				</form>
			</div>
		</div>
	</body>

</html>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.validate.min.js"></script>
<script src="__JS__/mui.min.js"></script>
<script src="__LIB__/layer.js"></script>
<script src="__JS__/image.zip.js"></script>
<script src="__JS__/index.js"></script>
<!-- 时间选择器-->
<link rel="stylesheet" type="text/css" href="__JS__/mui.picker.min.css" />
<script src="__JS__/mui.picker.min.js"></script>
<!-- end 时间选择器-->
<link href="__JS__/scs.min.css" rel="stylesheet">
<script src="__JS__/jquery.scs.min.js"></script>
<script src="__JS__/district.js"></script>
<script>
	app.getmap();
	$("#return").click(function() {
		location.href = "{:url('member/people')}";
	});
	(function($) {
		$.init();
		var btns = $('.btns');
		btns.each(function(i, btn) {
			btn.addEventListener('tap', function() {
				var _self = this;
				if(_self.picker) {
					_self.picker.show(function(rs) {
						_self.value = rs.text;
						_self.picker.dispose();
						_self.picker = null;
					});
				} else {
					var optionsJson = this.getAttribute('data-options') || '{}';
					var options = JSON.parse(optionsJson);
					var id = this.getAttribute('id');
					_self.picker = new $.DtPicker(options);
					_self.picker.show(function(rs) {
						_self.value = rs.text;
						_self.picker.dispose();
						_self.picker = null;
					});
				}
			}, false);
		});
	})(mui);
	$(function() {
		$("#myForm").validate({
			focusInvalid: true,
			onkeyup: false,
			ignore: "",
			onfocusout: false,
			showErrors: function(errorMap, errorList) {
				var msg = "";
				if(errorList != null && errorList != "") {
					msg = errorList[0]['message'];
					layer.msg(msg);
				}
			},
			submitHandler: function(form) { //表单提交句柄,为一回调函数，带一个参数：form   
				app.ajax(window.location.href, true);
			},
			rules: {
				real_name: {
					required: true
				},
				thumb: {
					required: true
				},
				real_name: {
					required: true
				},
				birth: {
					required: true
				},
				cert: {
					required: true
				},
				area: {
					required: true
				},
				address: {
					required: true
				}
			},
			messages: {
				real_name: {
					required: "请填写真实名称"
				},
				thumb: {
					required: "请上传本人照片"
				},
				phone: {
					required: "请填写联系电话"
				},
				birth: {
					required: "请选择出生年月"
				},
				cert: {
					required: "请填写职称"
				},
				area: {
					required: "请选择工作地区"
				},
				address: {
					required: "请填写详细地址"
				}
			}
		});
	});
</script>